<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <meta http-equiv="Content-Style-Type" content="text/css" />
    <!-- MOTW-DISABLED saved from url=(0014)about:internet -->
    <title>Calling external JavaScript functions</title>
    <link rel="StyleSheet" href="css/ScriptingWithJavaScript.css" type="text/css" media="all" />
    <link rel="StyleSheet" href="css/webworks.css" type="text/css" media="all" />
    <link rel="StyleSheet" href="webworks.css" type="text/css" media="all" />
    <script type="text/javascript" language="JavaScript1.2">
      <!--
        var  WebWorksRootPath = "";
      // -->
    </script>
  </head>
  <body>
    <div style="text-align: left;">
      <table cellspacing="0" summary="">
        <tr>
          <td>
            <a href="ScriptingWithJavaScript.22.10.html"><img src="images/prev.gif" alt="Previous" border="0" /></a>
          </td>
          <td>
            <a href="ScriptingWithJava.23.1.html"><img src="images/next.gif" alt="Next" border="0" /></a>
          </td>
        </tr>
      </table>
    </div>
    <hr align="left" />
    <blockquote>
      <h2 class="N_h1_Head1"><a name="165525">Calling external JavaScript functions</a></h2>
      <p class="b_Body"><a name="165554">In addition to executing JavaScript within a report, BIRT provides the option to use external JavaScript files located in the resource folder. Use the resources View and the property editor to associate these files with the selected report. For example, an external JavaScript file has the following content:</a></p>
      <div class="cf_CodeFirst"><a name="165801">function getMyValue(&nbsp;){</a></div>
      <div class="coi_CodeIndent"><a name="165802">return "This is a test of the add js button";</a></div>
      <div class="co_Code"><a name="165786">}</a></div>
      <p class="b_Body"><a name="165793">If this file is located in the resource folder, a report developer can select the resources tab of the property editor and add the JavaScript file to the report. The JavaScript file is not imported, but is referenced in the report. After making this association, the developer can call getMyValue(&nbsp;) in any BIRT expression or any of the event handler scripts.</a></p>
      <div class="co_Code" style="color: #000000; font-style: normal; font-variant: normal; font-weight: normal; text-transform: none; vertical-align: baseline"><a name="172621">&nbsp;</a></div>
    </blockquote>
    <hr align="left" />
    <table align="right" summary="">
      <tr>
        <td class="WebWorks_Company_Name_Bottom">
          <a href="notices.html">(c) Copyright Actuate Corporation 2013</a>
        </td>
      </tr>
    </table>
  </body>
</html>